<?php
/**
 * DotHerbert
 *
 * @package    objects
 * @subpackage factory
 * @copyright  2009 extreme-programmers
 * @license    http://dotherbert.extreme-programmers.com/license   BSD License
 * @version    $Id: ValueProperty.php 52 2009-10-02 15:43:55Z johannes.trink@extreme-programmers.com $
 */

namespace dotherbert\objects\factory\config;

/**
 * Value property
 *
 * @package    objects
 * @subpackage factory
 * @author     Johannes Trink <johannes.trink@extreme-programmers.com>
 */
class ValueProperty extends Property
{
    const TYPE_INT = 'int', TYPE_INTEGER = 'integer', TYPE_BOOL = 'bool', TYPE_BOOLEAN = 'boolean',
          TYPE_FLOAT = 'float', TYPE_DOUBLE = 'double', TYPE_REAL = 'real', TYPE_STRING = 'string';

    private $type, $value;

    /**
     * Constructor
     *
     * @param string $name
     * @param mixed  $value
     * @param string $type
     */
    public function __construct($name = null, $value = null, $type = self::TYPE_STRING)
    {
        parent::__construct($name);
        $this->value = $value;
        $this->type = $type;
    }

    /**
     * Get value
     *
     * @return mixed
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * Set value
     *
     * @param mixed $value
     * @return void
     */
    public function setValue($value)
    {
        $this->value = $value;
    }

    /**
     * Get type
     *
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set type
     *
     * @param string $type
     * @return void
     */
    public function setType($type)
    {
        $this->type = $type;
    }
}